Skip to content

Comments

add devcontainer and modify interactive install scripts#1

Open
chheis wants to merge 3 commits intovtz:mainfrom
chheis:chheis-add-devcontainer
Open

add devcontainer and modify interactive install scripts#1
chheis wants to merge 3 commits intovtz:mainfrom
chheis:chheis-add-devcontainer

Conversation

@chheis
Copy link

@chheis chheis commented Dec 23, 2025

I added a devcontainer configuration to setup a fast and easy environment.
But, with reusing the setup scripts the interactive input is still mandatory.
So did not work out yet.
Maybe in a collaborative cooperation we can fix it. Or use only the devcontainer setup?

Summary by CodeRabbit

  • Chores
    • Added containerized development environment configuration with pre-packaged development tools for streamlined setup
    • Enhanced development tools installation script with non-interactive mode support for automated environment configuration

@vtz
Copy link
Owner

vtz commented Jan 8, 2026

@chheis would you mind rebasing your PR so that I can approve it? What are the errors you're having with interactive mode? I can help to fix it.

@chheis
Copy link
Author

chheis commented Jan 10, 2026

@chheis would you mind rebasing your PR so that I can approve it? What are the errors you're having with interactive mode? I can help to fix it.

@vtz Merged the newest changes from your main branch.

The issue with the interactive mode is that I wanted to use your dev tools installation script, instead of putting them all in the dev container script. (Avoid double work)
But while I am enhancing your scripts with a parameter for CI they where not working as I expected.
Directly with post init scripts it was working fine, setting up the tool environment in the dev container, working with Codespaces is working as well (what i normally prefer)

So I think it would be up to you, to decide which way you like to go:

  1. CI first with dev container (easy to setup the build workflows) also with prebuild/released devcontainer images
  2. Workstation build first (with interactive scripts)

@coderabbitai
Copy link

coderabbitai bot commented Feb 2, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • ✅ Full review completed - (🔄 Check again to review again)
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In @.devcontainer/devcontainer.json:
- Line 16: The postCreateCommand currently clones opensomeip which will build a
fresh copy instead of the mounted workspace; update the postCreateCommand to
stop cloning and instead operate on the mounted workspace (e.g., remove the git
clone and the conditional if [ ! -d opensomeip ]; then ... fi, and ensure the
commands run from the workspace folder), then run chmod +x
./scripts/setup_deps.sh ./scripts/install_dev_tools.sh and invoke sudo
./scripts/setup_deps.sh && sudo ./scripts/install_dev_tools.sh --devcontainer &&
the existing mkdir build && cmake ... && cmake --build . -j so the container
builds the checked-out branch and local changes rather than a newly cloned repo.
- Around line 1-4: Update the devcontainer image to a fixed release tag instead
of :latest by replacing the "image" value
"ghcr.io/eclipse-score/devcontainer:latest" with a specific release (e.g.,
"ghcr.io/eclipse-score/devcontainer:v1.1.0" or another pinned tag like
1.0.0/0.1.0) in .devcontainer/devcontainer.json so the devcontainer uses a
reproducible version; ensure the "image" property string is updated accordingly.

In `@scripts/install_dev_tools.sh`:
- Around line 165-183: The PIP_CMD variable is currently a plain string and is
expanded unquoted (risking word-splitting); change PIP_CMD to a bash array
(e.g., PIP_CMD=(python3 -m pip)) and update all invocations to use the array
expansion form ("${PIP_CMD[@]}") including the echo/prints and both sudo and
non-sudo calls inside the DEVCONTAINER_MODE branch and the else branch so
commands like sudo $PIP_CMD install ... become sudo "${PIP_CMD[@]}" install ...
and $PIP_CMD install ... become "${PIP_CMD[@]}" install ... to safely handle
spaces and avoid SC2086.

Comment on lines +1 to +4
{
"name": "opensomeip on S-CORE devcontainer",
"image": "ghcr.io/eclipse-score/devcontainer:latest",
"remoteUser": "vscode",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

🧩 Analysis chain

🌐 Web query:

ghcr.io/eclipse-score/devcontainer image tags releases

💡 Result:

For ghcr.io/eclipse-score/devcontainer, the “release” versions correspond to Git tags in eclipse-score/devcontainer:

  • 0.1.0 (Nov 10, 2025) [1]
  • 1.0.0 (Nov 26, 2025) [1]
  • v1.1.0 (Nov 28, 2025) [1]

The repo README says you should use ghcr.io/eclipse-score/devcontainer:<version> where <version> is a “valid, published release”, and it also mentions floating tags main (tracks the main branch) and latest (tracks release tags). [2]

To list the actual tags available in GHCR, query the registry tags endpoint (may require auth depending on package visibility):
curl https://ghcr.io/v2/eclipse-score/devcontainer/tags/list [3]

Sources: [1] Git tags page, [2] repo README, [3] GHCR tag listing approach via GHCR v2 API.


🌐 Web query:

eclipse-score devcontainer GitHub repository

💡 Result:

The Eclipse S-CORE DevContainer is maintained in the GitHub repo:

  • eclipse-score/devcontainer (Common Devcontainer for Eclipse S-CORE) (github.com)

Citations:


Pin the devcontainer image to a specific release tag.

The eclipse-score/devcontainer repository recommends using specific versions instead of :latest. Available releases include 0.1.0, 1.0.0, and v1.1.0. Pinning improves reproducibility and supply-chain stability.

Proposed change
-  "image": "ghcr.io/eclipse-score/devcontainer:latest",
+  "image": "ghcr.io/eclipse-score/devcontainer:1.0.0",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
"name": "opensomeip on S-CORE devcontainer",
"image": "ghcr.io/eclipse-score/devcontainer:latest",
"remoteUser": "vscode",
{
"name": "opensomeip on S-CORE devcontainer",
"image": "ghcr.io/eclipse-score/devcontainer:1.0.0",
"remoteUser": "vscode",
🤖 Prompt for AI Agents
In @.devcontainer/devcontainer.json around lines 1 - 4, Update the devcontainer
image to a fixed release tag instead of :latest by replacing the "image" value
"ghcr.io/eclipse-score/devcontainer:latest" with a specific release (e.g.,
"ghcr.io/eclipse-score/devcontainer:v1.1.0" or another pinned tag like
1.0.0/0.1.0) in .devcontainer/devcontainer.json so the devcontainer uses a
reproducible version; ensure the "image" property string is updated accordingly.

}
},

"postCreateCommand": "set -e && sudo apt-get update && if [ ! -d opensomeip ]; then git clone https://github.com/vtz/opensomeip.git; fi && cd opensomeip && chmod +x ./scripts/setup_deps.sh ./scripts/install_dev_tools.sh && sudo ./scripts/setup_deps.sh && sudo ./scripts/install_dev_tools.sh --devcontainer && mkdir -p build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=ON && cmake --build . -j"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Avoid cloning the repo inside postCreateCommand.

The devcontainer already mounts the workspace; cloning a fresh copy will build the wrong code (e.g., main instead of the checked-out branch) and ignores local changes.

Proposed fix
-  "postCreateCommand": "set -e && sudo apt-get update && if [ ! -d opensomeip ]; then git clone https://github.com/vtz/opensomeip.git; fi && cd opensomeip && chmod +x ./scripts/setup_deps.sh ./scripts/install_dev_tools.sh && sudo ./scripts/setup_deps.sh && sudo ./scripts/install_dev_tools.sh --devcontainer && mkdir -p build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=ON && cmake --build . -j"
+  "postCreateCommand": "set -e && sudo apt-get update && cd ${containerWorkspaceFolder} && chmod +x ./scripts/setup_deps.sh ./scripts/install_dev_tools.sh && sudo ./scripts/setup_deps.sh && sudo ./scripts/install_dev_tools.sh --devcontainer && mkdir -p build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=ON && cmake --build . -j"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"postCreateCommand": "set -e && sudo apt-get update && if [ ! -d opensomeip ]; then git clone https://github.com/vtz/opensomeip.git; fi && cd opensomeip && chmod +x ./scripts/setup_deps.sh ./scripts/install_dev_tools.sh && sudo ./scripts/setup_deps.sh && sudo ./scripts/install_dev_tools.sh --devcontainer && mkdir -p build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=ON && cmake --build . -j"
"postCreateCommand": "set -e && sudo apt-get update && cd ${containerWorkspaceFolder} && chmod +x ./scripts/setup_deps.sh ./scripts/install_dev_tools.sh && sudo ./scripts/setup_deps.sh && sudo ./scripts/install_dev_tools.sh --devcontainer && mkdir -p build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=ON && cmake --build . -j"
🤖 Prompt for AI Agents
In @.devcontainer/devcontainer.json at line 16, The postCreateCommand currently
clones opensomeip which will build a fresh copy instead of the mounted
workspace; update the postCreateCommand to stop cloning and instead operate on
the mounted workspace (e.g., remove the git clone and the conditional if [ ! -d
opensomeip ]; then ... fi, and ensure the commands run from the workspace
folder), then run chmod +x ./scripts/setup_deps.sh
./scripts/install_dev_tools.sh and invoke sudo ./scripts/setup_deps.sh && sudo
./scripts/install_dev_tools.sh --devcontainer && the existing mkdir build &&
cmake ... && cmake --build . -j so the container builds the checked-out branch
and local changes rather than a newly cloned repo.

Comment on lines +165 to +183
# Prefer python -m pip to avoid pip/pip3 ambiguity
if python3 -m pip --version &> /dev/null; then
PIP_CMD="python3 -m pip"
else
echo "❌ pip not found. Install pip first."
exit 1
fi

echo "📦 Installing Python packages with $PIP_CMD..."
$PIP_CMD install --user gcovr pytest pytest-cov
echo "📦 Installing Python packages with: $PIP_CMD"

if [[ "$DEVCONTAINER_MODE" -eq 1 ]]; then
# Devcontainer: system-wide install requested
sudo $PIP_CMD install --upgrade pip
sudo $PIP_CMD install gcovr pytest pytest-cov
else
# Local developer default: user install (no sudo/pollution)
$PIP_CMD install --user --upgrade pip
$PIP_CMD install --user gcovr pytest pytest-cov
fi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Quote/array-wrap PIP_CMD to avoid word-splitting.

PIP_CMD="python3 -m pip" is expanded unquoted, which triggers SC2086 and can break if any path contains spaces. Use a bash array for safe invocation.

Proposed fix
-    if python3 -m pip --version &> /dev/null; then
-        PIP_CMD="python3 -m pip"
+    if python3 -m pip --version &> /dev/null; then
+        PIP_CMD=(python3 -m pip)
     else
         echo "❌ pip not found. Install pip first."
         exit 1
     fi
 
-    echo "📦 Installing Python packages with: $PIP_CMD"
+    echo "📦 Installing Python packages with: ${PIP_CMD[*]}"
 
     if [[ "$DEVCONTAINER_MODE" -eq 1 ]]; then
         # Devcontainer: system-wide install requested
-        sudo $PIP_CMD install --upgrade pip
-        sudo $PIP_CMD install gcovr pytest pytest-cov
+        sudo "${PIP_CMD[@]}" install --upgrade pip
+        sudo "${PIP_CMD[@]}" install gcovr pytest pytest-cov
     else
         # Local developer default: user install (no sudo/pollution)
-        $PIP_CMD install --user --upgrade pip
-        $PIP_CMD install --user gcovr pytest pytest-cov
+        "${PIP_CMD[@]}" install --user --upgrade pip
+        "${PIP_CMD[@]}" install --user gcovr pytest pytest-cov
     fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Prefer python -m pip to avoid pip/pip3 ambiguity
if python3 -m pip --version &> /dev/null; then
PIP_CMD="python3 -m pip"
else
echo "❌ pip not found. Install pip first."
exit 1
fi
echo "📦 Installing Python packages with $PIP_CMD..."
$PIP_CMD install --user gcovr pytest pytest-cov
echo "📦 Installing Python packages with: $PIP_CMD"
if [[ "$DEVCONTAINER_MODE" -eq 1 ]]; then
# Devcontainer: system-wide install requested
sudo $PIP_CMD install --upgrade pip
sudo $PIP_CMD install gcovr pytest pytest-cov
else
# Local developer default: user install (no sudo/pollution)
$PIP_CMD install --user --upgrade pip
$PIP_CMD install --user gcovr pytest pytest-cov
fi
# Prefer python -m pip to avoid pip/pip3 ambiguity
if python3 -m pip --version &> /dev/null; then
PIP_CMD=(python3 -m pip)
else
echo "❌ pip not found. Install pip first."
exit 1
fi
echo "📦 Installing Python packages with: ${PIP_CMD[*]}"
if [[ "$DEVCONTAINER_MODE" -eq 1 ]]; then
# Devcontainer: system-wide install requested
sudo "${PIP_CMD[@]}" install --upgrade pip
sudo "${PIP_CMD[@]}" install gcovr pytest pytest-cov
else
# Local developer default: user install (no sudo/pollution)
"${PIP_CMD[@]}" install --user --upgrade pip
"${PIP_CMD[@]}" install --user gcovr pytest pytest-cov
fi
🧰 Tools
🪛 Shellcheck (0.11.0)

[info] 177-177: Double quote to prevent globbing and word splitting.

(SC2086)


[info] 178-178: Double quote to prevent globbing and word splitting.

(SC2086)

🤖 Prompt for AI Agents
In `@scripts/install_dev_tools.sh` around lines 165 - 183, The PIP_CMD variable is
currently a plain string and is expanded unquoted (risking word-splitting);
change PIP_CMD to a bash array (e.g., PIP_CMD=(python3 -m pip)) and update all
invocations to use the array expansion form ("${PIP_CMD[@]}") including the
echo/prints and both sudo and non-sudo calls inside the DEVCONTAINER_MODE branch
and the else branch so commands like sudo $PIP_CMD install ... become sudo
"${PIP_CMD[@]}" install ... and $PIP_CMD install ... become "${PIP_CMD[@]}"
install ... to safely handle spaces and avoid SC2086.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants